package com.nulldev.util.java.swing.extSwing._testing;

import java.awt.Toolkit;

import javax.imageio.ImageIO;
import javax.swing.Icon;
import javax.swing.ImageIcon;

import com.nulldev.util.java.swing.extSwing.eLoginPane;
import com.nulldev.util.java.swing.extSwing.eLoginPaneEvents;
import com.nulldev.util.java.swing.extSwing.iNotify.Message;
import com.nulldev.util.java.swing.extSwing.iNotify.Message.MessageType;
import com.nulldev.util.java.swing.extSwing.lookandfeel.themes.Theme;
import com.nulldev.util.java.swing.extSwing.lookandfeel.themes.ThemeApplier;
import com.nulldev.util.java.swing.font.FontManager;
import com.nulldev.util.math.TimeUtil;

public class eLoginPaneDemo {
	public static void main(final String[] args) {
		FontManager.loadSystemSpecificFonts();
		final eLoginPane elp = eLoginPane.main(new eLoginPaneEvents() {
			
			@Override
			public boolean loginAttempt(String username, String password) {
				return (username.equals("demo") && password.equals("password123"));
			}

			@Override
			public void loginPassoff(String username) {
				System.out.println("Welcome, " + username + "!");
				System.exit(-1);
			}
		});
		final Message warn = new Message("Planned Maintainance", "The login servers are offline for up to an hour.", MessageType.ERROR);
		elp.add(warn);
		elp.generateCaptcha();
	}
}
